import Mock from 'mockjs2';
import { builder } from '../util';

// 字段校验，一般用于字段重复校验
const validateField = () => {
  const code = Mock.Random.pick([20001, 200]);
  const message = code === 20001 ? '名称重复' : '';
  
  return builder('', message, code);
}

Mock.mock(/\/fieldRepeatCheck/, 'get', validateField);
